package com.vote.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * The persistent class for the house database table.
 * 
 */
@Entity
@Table(name = "QUESTION_INFO")
public class QuestionInfo implements Serializable {	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2669306346729265082L;

	private Long id;
	
	private String partA;
	
	private String partB;
	
	private String title;
		
	private Long type;	
	
	private Long status;
	
	private Long sequenceA;
	
	private Long sequenceB;
	
	private String remark;
	
	private Date createTime;
	
	private Date updateTime;
	
	private Set<QuestionOpt> questionOpts;		
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}	

	@Column(name = "TYPE")
	public Long getType() {
		return type;
	}

	public void setType(Long type) {
		this.type = type;
	}
	
	@Column(name = "TITLE")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "CREATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	
	@OneToMany(mappedBy = "questionInfo")
	@OrderBy("sequence")
	public Set<QuestionOpt> getQuestionOpts() {
		return questionOpts;
	}

	public void setQuestionOpts(Set<QuestionOpt> questionOpts) {
		this.questionOpts = questionOpts;
	}

	@Column(name = "STATUS")
	public Long getStatus() {
		return status;
	}

	public void setStatus(Long status) {
		this.status = status;
	}

	@Column(name = "PART_A")
	public String getPartA() {
		return partA;
	}

	public void setPartA(String partA) {
		this.partA = partA;
	}

	@Column(name = "PART_B")
	public String getPartB() {
		return partB;
	}

	public void setPartB(String partB) {
		this.partB = partB;
	}

	@Column(name = "SEQUENCE_A")
	public Long getSequenceA() {
		return sequenceA;
	}

	public void setSequenceA(Long sequenceA) {
		this.sequenceA = sequenceA;
	}

	@Column(name = "SEQUENCE_B")
	public Long getSequenceB() {
		return sequenceB;
	}

	public void setSequenceB(Long sequenceB) {
		this.sequenceB = sequenceB;
	}
	
}